package com.spzx.product.service.impl;

import com.spzx.product.api.domain.Brand;
import com.spzx.product.mapper.BrandMapper;
import com.spzx.product.service.IBrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class BrandServiceImpl implements IBrandService {

    @Autowired
    BrandMapper brandMapper;

    // ctrl + i     ctrl + o

    @Override
    public List<Brand> selectBrandList(Brand brand) {
        return brandMapper.selectBrandList(brand);
    }

    @Override
    public Brand selectBrandById(Long id) {
        return brandMapper.selectBrandById(id);
    }


    @Override
    public int addBrand(Brand brand) {
        return brandMapper.addBrand(brand);
    }

    @Override
    public int updateBrand(Brand brand) {
        return brandMapper.updateBrand(brand);
    }

    @Override
    public int deleteBatch(List<Long> ids) {
        return brandMapper.deleteBatch(ids);
    }

    @Override
    public List<Brand> selectBrandAll() {
        return brandMapper.selectBrandList(new Brand());
    }
}
